Excel Configuration Guide
This guide explains how to configure the Excel import process using JSON configuration files. The configuration structure allows you to define various aspects of Excel processing, including logging, sheet specifications, and feature handling.
Configuration Structure
The configuration file consists of three main sections:
GENERAL_CONFIGS
: Global settings that affect the entire import processLOGGING_CONFIGS
: Detailed logging configuration optionsSHEET_SPECS
: Array of sheet-specific configurations
General Configurations
The GENERAL_CONFIGS
section controls the overall behavior of the Excel import process.
{
"FEATURES_AS_HTML_OUTPUT": "true",
"MINIMIZE_LOGGING": "true",
"MISSING_DATA_DEFAULT_VALUE": "-",
"USE_LOGGER": "true",
"FILE_TYPE": "csv",
// ... other general configs
}
Key settings include:
FEATURES_AS_HTML_OUTPUT
: Enables HTML output format for featuresMISSING_DATA_DEFAULT_VALUE
: Default value for missing data fieldsFILE_TYPE
: Output file type (e.g., "csv")EXPORT_DELIMITER
: Character used to separate fields in export filesCUSTOM_EXCEL_CODE
: Enables custom Excel processing code
Logging Configuration
The LOGGING_CONFIGS
section allows fine-grained control over logging behavior for different components of the system.
{
"APPEND_OUTPUT_CONTROLLER_LOGGING": "true",
"PROCESSOR_RULE_LOGGING": "true",
"EXCEL_TABLE_LOAD_LOGGING": "true"
// ... other logging configs
}
Each logging option can be enabled or disabled independently to help with debugging and monitoring specific components.
Sheet Specifications
The SHEET_SPECS
array contains configurations for individual sheets. Each sheet specification includes:
Basic Sheet Properties
NAME
: Identifier for the sheet configurationTARGET_SHEET
: Name of the sheet in the Excel fileHEADER_ROW_INDEX
: Row number containing headersFILE_TYPE
: Type of processing to apply ("LAYOUT" or "OFFERS")PATTERN_MATCH
: Regular expression pattern for matching
Sheet Configuration Options
Each sheet has a CONFIG
object that can include:
Row Checking
"RowCheck": {
"TYPE": "CONDITION",
"FEATURE": "TopBorder.Thin",
"LOCATION": {
"TYPE": "COLUMN",
"INDEX": "15"
}
}
Cluster Container Settings
"ClusterContainer": {
"CONTAINER_HEIGHT_COVERAGE_DELTA": "1",
"CLUSTER_CONTAINER_SEARCH_ORDER": ["FIRST", "2", "3", "4", "LAST"]
}
Feature Search Configuration
The FeatureSearch
section defines search criteria for specific features:
"FeatureSearch": {
"COUNTRY_CODE": {
"TYPE": "OR_ARRAY",
"FEATURES": [
"FONT_COLOR*FF000000*FIRST*15",
"FONT_COLOR*FF000000*FIRST*17"
]
}
}
Field Mapping
For OFFERS type sheets, you can define field mappings:
"FieldMapping": {
"Precio Normal": "PRECIO NORMAL",
"Precio SE": "PRECIO SE"
}
Advanced Features
Reusable Formats
Define common formats that can be referenced throughout the configuration:
"ReusableFormats": {
"BlueText": {
"CODE": "6",
"FORMAT_CODE": "FF0000FF"
}
}
Field Value Reprocessing
Configure rules for transforming field values based on conditions:
"FieldValueReprocessing": [
{
"FIELD": "OFFER_TYPE",
"RULES": [
{
"VALUE": "TO319",
"REPLACEMENT_VALUE": "TO309",
"CONDITIONS": [
{
"COUNTRY_CODE": "=MX",
"INSTRUCTIONS": "~=GRATIS"
}
]
}
]
}
]
Best Practices
- Always specify a
MISSING_DATA_DEFAULT_VALUE
to handle null or undefined values - Use meaningful names for sheet configurations
- Keep logging configurations organized by component
- Test pattern matching expressions before deployment
- Document custom field mappings for maintainability
Configuration Examples
Basic Layout Sheet
{
"NAME": "A1",
"TARGET_SHEET": "PXP",
"HEADER_ROW_INDEX": "9",
"FILE_TYPE": "LAYOUT",
"PATTERN_MATCH": "[A-Za-z][A-Za-z]\\sC\\d\\d\\s\\d\\d\\d\\d",
"CONFIG": {
"MAX_COLUMN": 36,
// ... other config options
}
}
Basic Offers Sheet
{
"NAME": "A2",
"TARGET_SHEET": "BD",
"HEADER_ROW_INDEX": "0",
"FILE_TYPE": "OFFERS",
"CONFIG": {
"MAX_COLUMN": 36,
"FieldMapping": {
"Precio Normal": "PRECIO NORMAL",
"Precio SE": "PRECIO SE"
}
}
}
Troubleshooting
Common issues and their solutions:
-
Missing Headers
- Verify
HEADER_ROW_INDEX
is correct - Check sheet name matches
TARGET_SHEET
- Verify
-
Pattern Matching Failures
- Test
PATTERN_MATCH
expressions separately - Ensure special characters are properly escaped
- Test
-
Field Mapping Issues
- Confirm source and target field names
- Check for case sensitivity
- Verify field exists in source data